package backend.parser.antlr;


import backend.parser.antlr.mysql.MySqlParserBaseVisitor;
import backend.parser.antlr.mysql.MySqlParser;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.TokenStreamRewriter;


public class ColumnAddTablePrefix extends MySqlParserBaseVisitor {

    private String tableName;

    private TokenStreamRewriter rewriter;

    public ColumnAddTablePrefix(String tableName, TokenStream tokens) {
        this.tableName = tableName;
        rewriter = new TokenStreamRewriter(tokens);
    }


    public TokenStreamRewriter getRewriter() {
        return rewriter;
    }


//    @Override
//    public String visitColumnReference(MySqlParser.ColumnReferenceContext ctx) {
//        String columnName = ctx.getChild(0).getText();
//        rewriter.insertBefore(ctx.start, tableName + ".");
//        return columnName;
//    }


}
